Version

AddRange(UltraTreeNode[],Boolean) Method

Adds each node in the specified array to the selection.
Syntax
'Declaration
 
Public Overloads Sub AddRange( _
   ByVal nodes() As UltraTreeNode, _
   ByVal clearExistingSelection As Boolean _
) 
public void AddRange( 
   UltraTreeNode[] nodes,
   bool clearExistingSelection
)

Parameters

nodes
An UltraTreeNode array which contains the instances to be added to the existing selection.
clearExistingSelection
Specifies whether any existing selection should be cleared before selecting the specified nodes.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionThrown if the specified node array is null (Nothing in VB).
System.ExceptionThrown if this method is called on a different SelectedNodesCollection instance than the one that is returned from the controls' SelectedNodes property.
System.ExceptionThrown if the specified node array contains a node which is associated with a different control than the one with which this instance is associated.
System.ExceptionThrown if the specified node array contains a null reference.
Remarks

The Selected property can be set on an individual node to programmatically select that node; doing this for large numbers of nodes, however, can have performance ramifications. Use the AddRange method to select multiple nodes in one atomic operation.

A node that cannot be part of an extended selection, i.e., one whose Override.SelectionType property does not resolve to 'Extended' or 'ExtendedAutoDrag', cannot be selected via the AddRange method. No exception is thrown in this scenario, but such nodes are excluded from the resulting selection.

The AddRange method is bound by the same selection rules as those enforced through the user interface. If, for example, selection across different Nodes collections is disallowed, and this method is called with an array containing one or more nodes from a different collection that the one that contains the current selection, the selection will not be changed, unless true is specified as the value of the clearExistingSelection parameter.

If selection across different Nodes collections is disallowed, and the specified array contains nodes from different Nodes collections, only the nodes that belong to the same collection as the first node in the array will be added to the selection.

The AddRange method causes the BeforeSelect and (assuming BeforeSelect is not canceled) AfterSelect events to fire once for each time the method is called.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also